<template>
  <div class="header">
    <div class="tab-content left">
<!--      <router-link :exact="true" active-class="active" to="/index" class="tab-item left">首页</router-link>-->
      <router-link :exact="true" active-class="active" :to="{path:'/',query:{name:'平台运营'}}" class="tab-item right">平台运营</router-link>
      <router-link :exact="true" active-class="active" :to="{path:'/statistics-7',query:{name:'⽤⼾使⽤'}}" class="tab-item right">⽤⼾使⽤</router-link>
      <router-link :exact="true" active-class="active" :to="{path:'/statistics-1',query:{name:'就业态势'}}" class="tab-item left">劳动力情况</router-link>
      <router-link :exact="true" active-class="active" to="/statistics-9" class="tab-item left">零工市场</router-link>

    </div>
      <div class="title FZHZGBJ">定西⼈⼒资源服务数据平台</div>
     <div class="logout">
        <span><i class="el-icon-switch-button" @click="logout"></i></span>
<!--        <el-dropdown-menu slot="dropdown">-->
<!--          <el-dropdown-item class="text" @click="logout">退出登录</el-dropdown-item>-->
<!--        </el-dropdown-menu>-->
     </div>
    <div class="tab-content right">
      <router-link :exact="true" active-class="active" to="/statistics-10" class="tab-item left">就业服务</router-link>
      <router-link :exact="true" active-class="active" to="/statistics-2" class="tab-item left">产业用工情况</router-link>
      <router-link :exact="true" active-class="active" to="/statistics-6" class="tab-item right">重点企业</router-link>
      <router-link :exact="true" active-class="active" :to="{path:'/statistics-8',query:{name:'职业培训分析'}}" class="tab-item right">职业培训</router-link>
    </div>
  </div>
</template>

<script>
import {removeToken} from "@/utils/auth";
export default {
  name: "TopTab",
  data() {
    return {}
  },
  methods: {
    logout(){
      this.$confirm('确定要退出登录吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        removeToken()
        this.$router.push({
          name: 'Login'
        })
      }).catch(() => {

      });
    }
  },
}
</script>

<style scoped lang="scss">
.header {
  height: 100px;
  width: 100%;
  background: url("~@/assets/images/header/title-bg.png") no-repeat center;
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  position: relative;
  .title{
    width: 550px;
    align-self: flex-start;
    text-align: center;
    color: #fff;
    font-size: 34px;
    margin-top: 16px;
  }
  .logout{
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 55px;
    position: absolute;
    margin-right: 30px;
    z-index: 9999;
    .el-icon-switch-button{
      color: #1AC9FF;
      font-size: 18px;
      font-weight: bold;
      margin-right: 30px;
    }
    .text{
      padding: 2px 16px;
      color: #ffffff;
      //border: 1px solid #ffffff;
     // border-radius: 30px;
      font-size: 14px;
      z-index: 30;
    }
  }
  .tab-content{
    width: calc((100% - 550px)/2);
    align-self: flex-end;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    margin-bottom: 10px;
    z-index: 9;
    .tab-item{
      width: 130px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
    }
    .tab-item.left{
      background: url("~@/assets/images/header/left-tab.png") no-repeat center;
      background-size: 110%;
    }
    .tab-item.right{
      background: url("~@/assets/images/header/right-tab.png") no-repeat center;
      background-size: 110%;
    }
    .tab-item.left.active{
      background: url("~@/assets/images/header/left-tab-active.png") no-repeat center;
      background-size: 110%;
    }
    .tab-item.right.active{
      background: url("~@/assets/images/header/right-tab-active.png") no-repeat center;
      background-size: 110%;
    }
  }
  .tab-content.left{
    padding-right: 30px;
  }
  .tab-content.right{
    padding-left: 30px;
  }
}
</style>

